
import time
from faker import Faker
import pandas as pd
from utils import get_timestamp, get_md5, read_excel_list, get_files_path


def sleep(n_secs):
    time.sleep(n_secs)

#可以对httprunner能力扩展
def getSign(n):
    list_sign =[]
    fake = Faker('zh_CN')
    for i in range(n):
        phone=fake.phone_number()
        to_time=get_timestamp()
        to_sign = f'{fake.phone_number()}testfan{to_time}'
        list_sign.append((phone,to_time,get_md5(to_sign)))
    return list_sign

def get_excel(filename):
    return read_excel_list(filename)


def get_excel_data(filename):
    file_path = get_files_path(filename)
    ex_data = pd.read_excel(file_path, sheet_name=0) #dataframe转list
    return ex_data.values.tolist()


if __name__ == '__main__':
    #print(getSign(3))
    print(get_excel_data('case.xlsx'))


